@mvarble/mesearch-workflow 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +109 -2
- package/agents/reference/authoring.md +127 -0
- package/agents/reference/workflow.md +106 -0
- package/agents/skills/wf-abandon/SKILL.md +16 -0
- package/agents/skills/wf-approve/SKILL.md +23 -0
- package/agents/skills/wf-build/SKILL.md +41 -0
- package/agents/skills/wf-plan/SKILL.md +47 -0
- package/agents/skills/wf-publish/SKILL.md +41 -0
- package/agents/skills/wf-reopen/SKILL.md +20 -0
- package/agents/skills/wf-resume/SKILL.md +16 -0
- package/agents/skills/wf-start/SKILL.md +25 -0
- package/agents/skills/wf-status/SKILL.md +12 -0
- package/agents/skills/wf-writeup/SKILL.md +58 -0
- package/app/ambient.d.ts +71 -0
- package/app/lib/components/CopyCode.svelte +24 -0
- package/app/lib/components/DocumentMap.svelte +38 -0
- package/app/lib/components/DocumentPage.svelte +184 -0
- package/app/lib/components/Icon.svelte +35 -0
- package/app/lib/components/ImageFigure.svelte +213 -0
- package/app/lib/components/LinkList.svelte +46 -0
- package/app/lib/components/ModelGraph.svelte +169 -0
- package/app/lib/components/OpenEntry.svelte +35 -0
- package/app/lib/components/PageList.svelte +35 -0
- package/app/lib/components/PrevNext.svelte +24 -0
- package/app/lib/components/Proof.svelte +12 -0
- package/app/lib/components/Shell.svelte +55 -0
- package/app/lib/components/Sidebar.svelte +77 -0
- package/app/lib/components/StageRail.svelte +30 -0
- package/app/lib/components/Statement.svelte +41 -0
- package/app/lib/components/Tex.svelte +25 -0
- package/app/lib/components/ThemeToggle.svelte +17 -0
- package/app/lib/components/Timeline.svelte +31 -0
- package/app/lib/components/Toc.svelte +41 -0
- package/app/lib/components/TopBar.svelte +55 -0
- package/app/lib/components/TrackCard.svelte +20 -0
- package/app/lib/documents.ts +52 -0
- package/app/lib/graph/describe.ts +29 -0
- package/app/lib/graph/geometry.ts +296 -0
- package/app/lib/graph/spec.ts +158 -0
- package/app/lib/kit.ts +11 -0
- package/app/lib/load.ts +12 -0
- package/app/lib/map.ts +6 -0
- package/app/lib/nav.ts +91 -0
- package/app/lib/questions.ts +33 -0
- package/app/lib/server/document.ts +117 -0
- package/app/lib/server/map.ts +41 -0
- package/app/lib/server/markdown.ts +134 -0
- package/app/lib/server/open.ts +35 -0
- package/app/lib/server/repo.ts +6 -0
- package/app/lib/server/specs.ts +26 -0
- package/app/lib/server/title.ts +9 -0
- package/app/lib/state/persisted.svelte.ts +40 -0
- package/app/lib/state/theme.svelte.ts +24 -0
- package/app/lib/tex.ts +99 -0
- package/app/params/slug.ts +5 -0
- package/app/params/track.ts +5 -0
- package/app/routes/+layout.ts +2 -0
- package/app/routes/[...key].md/+server.ts +19 -0
- package/app/routes/[track=track]/+page.server.ts +14 -0
- package/app/routes/[track=track]/+page.svelte +24 -0
- package/app/routes/[track=track]/[slug=slug]/+page.server.ts +9 -0
- package/app/routes/[track=track]/[slug=slug]/+page.svelte +7 -0
- package/app/routes/[track=track]/[slug=slug]/+page.ts +4 -0
- package/app/routes/archive/+page.server.ts +18 -0
- package/app/routes/archive/+page.svelte +44 -0
- package/app/routes/archive/[entry=slug]/+page.server.ts +9 -0
- package/app/routes/archive/[entry=slug]/+page.svelte +7 -0
- package/app/routes/archive/[entry=slug]/+page.ts +4 -0
- package/app/routes/archive/[entry=slug]/[name=slug]/+page.server.ts +14 -0
- package/app/routes/archive/[entry=slug]/[name=slug]/+page.svelte +7 -0
- package/app/routes/archive/[entry=slug]/[name=slug]/+page.ts +4 -0
- package/app/routes/llms-full.txt/+server.ts +17 -0
- package/app/routes/llms.txt/+server.ts +50 -0
- package/app/routes/math/+page.server.ts +21 -0
- package/app/routes/math/+page.svelte +56 -0
- package/app/routes/math/[slug=slug]/+page.server.ts +8 -0
- package/app/routes/math/[slug=slug]/+page.svelte +7 -0
- package/app/routes/math/[slug=slug]/+page.ts +4 -0
- package/app/styles/base.css +98 -0
- package/app/styles/code.css +83 -0
- package/app/styles/index.css +17 -0
- package/app/styles/katex.css +14 -0
- package/app/styles/layout.css +545 -0
- package/app/styles/text.css +96 -0
- package/app/styles/tokens/dimensions.css +31 -0
- package/app/styles/tokens/typography.css +33 -0
- package/app/styles/tokens.css +2 -0
- package/app/styles/utils/archive.css +339 -0
- package/app/styles/utils/buttons.css +28 -0
- package/app/styles/utils/callouts.css +41 -0
- package/app/styles/utils/cards.css +95 -0
- package/app/styles/utils/graph.css +186 -0
- package/app/styles/utils/map.css +45 -0
- package/app/styles/utils/tables.css +25 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +88 -0
- package/dist/cli.js.map +1 -0
- package/dist/engine/cli.d.ts +12 -0
- package/dist/engine/cli.js +744 -0
- package/dist/engine/cli.js.map +1 -0
- package/dist/engine/config.d.ts +40 -0
- package/dist/engine/config.js +16 -0
- package/dist/engine/config.js.map +1 -0
- package/dist/engine/lib.d.ts +108 -0
- package/dist/engine/lib.js +375 -0
- package/dist/engine/lib.js.map +1 -0
- package/dist/engine/main.d.ts +1 -0
- package/dist/engine/main.js +45 -0
- package/dist/engine/main.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/site/hooks.d.ts +27 -0
- package/dist/site/hooks.js +2 -0
- package/dist/site/hooks.js.map +1 -0
- package/dist/site/index.d.ts +1 -0
- package/dist/site/index.js +2 -0
- package/dist/site/index.js.map +1 -0
- package/dist/site/preset/index.d.ts +15 -0
- package/dist/site/preset/index.js +556 -0
- package/dist/site/preset/index.js.map +1 -0
- package/dist/site/preset/runtime.d.ts +42 -0
- package/dist/site/preset/runtime.js +99 -0
- package/dist/site/preset/runtime.js.map +1 -0
- package/dist/site/preset/types.d.ts +87 -0
- package/dist/site/preset/types.js +2 -0
- package/dist/site/preset/types.js.map +1 -0
- package/dist/site/vite.d.ts +14 -0
- package/dist/site/vite.js +202 -0
- package/dist/site/vite.js.map +1 -0
- package/dist/sync/index.d.ts +17 -0
- package/dist/sync/index.js +175 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/init.d.ts +7 -0
- package/dist/sync/init.js +62 -0
- package/dist/sync/init.js.map +1 -0
- package/dist/sync/render.d.ts +3 -0
- package/dist/sync/render.js +118 -0
- package/dist/sync/render.js.map +1 -0
- package/dist/sync/site.d.ts +3 -0
- package/dist/sync/site.js +58 -0
- package/dist/sync/site.js.map +1 -0
- package/package.json +78 -3
- package/templates/.agents/reference/authoring.md +11 -0
- package/templates/.agents/reference/stages/README.md +4 -0
- package/templates/AGENTS.md +36 -0
- package/templates/site/content/landing.md +5 -0
- package/templates/site/katex.config.ts +5 -0
- package/templates/site/package.json +22 -0
- package/templates/site/src/app.d.ts +8 -0
- package/templates/site/src/app.html +23 -0
- package/templates/site/src/lib/components/Logo.svelte +12 -0
- package/templates/site/src/lib/site.ts +39 -0
- package/templates/site/src/routes/+layout.server.ts +3 -0
- package/templates/site/src/routes/+layout.svelte +11 -0
- package/templates/site/src/routes/+page.server.ts +3 -0
- package/templates/site/src/routes/+page.svelte +34 -0
- package/templates/site/src/routes/+page.ts +7 -0
- package/templates/site/src/styles/index.css +4 -0
- package/templates/site/src/styles/tokens/colors.css +107 -0
- package/templates/site/static/favicon.svg +1 -0
- package/templates/site/tsconfig.json +20 -0
- package/templates/site/vite.config.ts +4 -0
- package/templates/workflow.config.ts +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matthew Varble
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,110 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mvarble/mesearch-workflow
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Documented development: every change to a project is an **entry** that moves through stages a person approves (a plan, a build, the pages that say what now is), and is kept, as it was approved, in an archive on the project's documentation site. This package is everything that is the same from project to project:
|
|
4
|
+
|
|
5
|
+
- **the engine**, `bin/wf`, which keeps each entry's record and refuses an edit its stage does not allow, configured by the project's `workflow.config.ts`;
|
|
6
|
+
- **the skills** that drive it (`/wf-start`, `/wf-plan`, `/wf-build`, `/wf-publish`, `/wf-approve`, …) and the procedure they follow;
|
|
7
|
+
- **the documentation site**: a SvelteKit app whose pages, math notes and archive are the project's `site/content/`, with the content database's preset, the routes, the components and the styles.
|
|
8
|
+
|
|
9
|
+
What differs between projects (their kinds of entry, their code, their stages' particulars, their tracks, their own components) stays in the project.
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
pnpm add -D @mvarble/mesearch-workflow # in site/
|
|
13
|
+
pnpm exec mesearch-wf init # workflow.config.ts, AGENTS.md, a site, the guard, then sync
|
|
14
|
+
pnpm exec mesearch-wf sync # after an update: bring what is the package's up to date
|
|
15
|
+
pnpm exec mesearch-wf diff # in CI: fail if a managed file is not this version's
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## A project
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
workflow.config.ts the project's kinds, stages and code
|
|
22
|
+
AGENTS.md the project's own instructions to agents
|
|
23
|
+
bin/wf managed: runs the engine
|
|
24
|
+
.workflow/engine/ managed: the engine, vendored
|
|
25
|
+
.workflow/managed.json managed: what sync wrote, with each file's hash
|
|
26
|
+
.workflow/active the entry this branch works on, written by bin/wf
|
|
27
|
+
.agents/skills/wf-*/ managed: the workflow's skills (linked into .claude/skills/)
|
|
28
|
+
.agents/skills/<own>/ the project's own skills, such as a stage only it has
|
|
29
|
+
.agents/reference/mesearch/ managed: workflow.md, authoring.md, markup.md
|
|
30
|
+
.agents/reference/authoring.md the project's own writing conventions
|
|
31
|
+
.agents/reference/stages/<stage>.md what a stage asks of this project beyond its skill
|
|
32
|
+
.claude/settings.json runs `bin/wf guard` before every edit
|
|
33
|
+
site/ the documentation site (below)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Managed files
|
|
37
|
+
|
|
38
|
+
A _managed_ file belongs to this package. `mesearch-wf sync` writes it, `.workflow/managed.json` records its hash, `bin/wf guard` refuses an edit to it (with a message saying where to make the change instead), and `bin/wf check` fails when it has changed, so CI catches an edit made around the guard. A change to one is made here and reaches every project with the next `sync`. A file a newer version no longer ships is removed by `sync`, unless it was changed in the project, in which case it is kept and reported.
|
|
39
|
+
|
|
40
|
+
The engine is vendored, as plain JavaScript with no dependencies, because the guard runs before every edit, including in a fresh clone where nothing is installed. It loads `workflow.config.ts` with Node's type stripping (Node 22.18 or later), so the config imports nothing but types:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import type { WorkflowConfig } from '@mvarble/mesearch-workflow';
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
project: 'skoro', // as skills and messages name it: "skoro's development workflow"
|
|
47
|
+
code: [/^crates\//, /^Cargo\.(toml|lock)$/], // what opens at the build
|
|
48
|
+
describe: { code: '`crates/`, `Cargo.*`' }, // how the reference documents name it
|
|
49
|
+
kinds: {
|
|
50
|
+
feature: {
|
|
51
|
+
stages: ['math', 'implementation', 'plan', 'build', 'publish'],
|
|
52
|
+
describe: 'needs mathematics worked out',
|
|
53
|
+
},
|
|
54
|
+
chore: { stages: ['plan', 'build', 'publish'], describe: 'a port or a refactor' },
|
|
55
|
+
},
|
|
56
|
+
stages: {
|
|
57
|
+
math: { document: true, unlocks: ['math'] },
|
|
58
|
+
implementation: { document: true, sections: ['Tests'] },
|
|
59
|
+
plan: { document: true, checklist: true, editableDuring: ['build'] },
|
|
60
|
+
build: { unlocks: ['code'] },
|
|
61
|
+
publish: { unlocks: ['pages'] },
|
|
62
|
+
},
|
|
63
|
+
entryFields: { crates: '[]' }, // more frontmatter for a new entry's index.md
|
|
64
|
+
pagesOptional: ['chore'], // kinds whose publish need not change a page
|
|
65
|
+
checks: { publish: (context) => [] }, // the project's own conditions for approving a stage
|
|
66
|
+
} satisfies WorkflowConfig;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
| field | |
|
|
70
|
+
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
71
|
+
| `kinds` | Each kind's stages, in order, and a sentence saying when an entry is of that kind. |
|
|
72
|
+
| `stages` | `document`: written as `<stage>.md` and frozen once approved. `unlocks`: `math`, `code` or `pages`, open from then on. `sections`: headings it must have. `checklist`: a plan, whose boxes are ticked later without reopening it. `editableDuring`: later stages that may still edit it. `skill`: `/wf-<stage>` by default. `describe`: what it produces. |
|
|
73
|
+
| `code`, `free` | What counts as code, and paths open at every stage (a ledger of facts, say). |
|
|
74
|
+
| `content`, `math` | `site/content` and `math` by default; `math: false` for a project without math notes. |
|
|
75
|
+
| `entryFields` | Frontmatter `bin/wf start` adds to a new entry. |
|
|
76
|
+
| `checks` | Per stage, a function of the entry (`root`, `slug`, `index`, `text`, `changed`, `list(field)`) returning problems, which `wf approve` reports beside its own. |
|
|
77
|
+
|
|
78
|
+
`build` and `publish` are stages the engine knows by name: a build is approved only when every checklist box is ticked and the tree is clean, and a publish only when the pages it changed are listed in the entry's `pages` and what it changed in done entries in its `amends`.
|
|
79
|
+
|
|
80
|
+
### Skills
|
|
81
|
+
|
|
82
|
+
`sync` writes `wf-start`, `wf-approve`, `wf-reopen`, `wf-abandon`, `wf-resume`, `wf-status` and the stage skills `wf-plan`, `wf-build`, `wf-publish` and `wf-writeup`, filled in with the project's name and kinds. A stage skill holds what every project's stage does, and reads `.agents/reference/stages/<stage>.md` for what this project's does besides (what to read first, the plan's template, how a task is checked, which pages a publish changes). A stage only one project has, such as skoro's `math` or a measurement stage, is that project's own skill, written beside the managed ones; it reads `.agents/reference/mesearch/workflow.md` for the procedure.
|
|
83
|
+
|
|
84
|
+
## The documentation site
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
// site/vite.config.ts
|
|
88
|
+
import { docsSite } from '@mvarble/mesearch-workflow/site';
|
|
89
|
+
import { defineConfig } from 'vite';
|
|
90
|
+
|
|
91
|
+
export default defineConfig({ plugins: await docsSite() });
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`docsSite()` sets up the content database with the docs preset, SvelteKit with mdsvex (KaTeX, callouts, heading anchors, quoted code), and two virtual modules through which the app reads the project:
|
|
95
|
+
|
|
96
|
+
| `$site` | from |
|
|
97
|
+
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
98
|
+
| structure | `src/lib/site.ts`: `SITE`, `TRACKS`, `MATH`, `ARCHIVE`, `DOCUMENTS`, and optionally `MATH_PARTS`, `KIND_LABELS`, `STATUS_LABELS`, `NAV` (`mathBefore`), `LLMS` (`about`), `THEME_KEY` |
|
|
99
|
+
| logo | `src/lib/components/Logo.svelte`, as `<Logo variant="icon" \| "lockup" />` |
|
|
100
|
+
| macros | `katex.config.ts` |
|
|
101
|
+
| stages | `../workflow.config.ts`, for the archive's stage rail |
|
|
102
|
+
| `$site/server` | `src/lib/server/site.ts`, if any: `hooks: SiteHooks`, with `entryChanges` (what an entry's page lists under "What it changed" besides its pages) and `markdown` (rewrites for the Markdown export of a component of the site's own) |
|
|
103
|
+
|
|
104
|
+
`sync` writes a wrapper of a few lines for every route the app ships (`src/routes/…`, `src/params/…`) and for what documents import by `$lib` path (`Statement`, `Proof`, `ModelGraph`, `ImageFigure`, `TrackCard`, `graph/spec`). The site keeps its home page and layout, built from `Shell` and the app's other components (`@mvarble/mesearch-workflow/app/lib/components/…`), its colours (`src/styles/tokens/colors.css`, beside `@mvarble/mesearch-workflow/styles/index.css`), and any route and component of its own. `src/app.d.ts` takes the virtual modules' types with `/// <reference types="@mvarble/mesearch-workflow/ambient" />`.
|
|
105
|
+
|
|
106
|
+
The site's `Statement`, `Proof`, `Toc`, `ThemeToggle` and `Icon` share names with [`@mvarble/mesearch-ui`](../ui)'s but not their markup: these are the documentation site's look, which skoro and autonomy-fusion-box had.
|
|
107
|
+
|
|
108
|
+
## Development
|
|
109
|
+
|
|
110
|
+
`test/engine/` runs the engine against configs shaped like skoro's and autonomy-fusion-box's, each with the test suite its repository had. `test/preset/` runs the preset against both repositories' fixtures. `test/sync/` sets up throwaway repositories and runs the vendored engine in them with nothing installed. The app itself is built, type-checked and tested by [`docs-example/`](../../docs-example), a site with a document of every kind.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Writing a project's documentation
|
|
2
|
+
|
|
3
|
+
How the documents in `site/content/` are written in a project documented through `@mvarble/mesearch-workflow`: what each kind promises, where it goes, its frontmatter, links, prose, callouts, code and figures.
|
|
4
|
+
`markup.md`, beside this file, says how mathematics, numbered equations, statements and citations are written.
|
|
5
|
+
|
|
6
|
+
This file and `markup.md` belong to the package, and `mesearch-wf sync` replaces them with the current version, so they are never edited here.
|
|
7
|
+
The project's own conventions are in `.agents/reference/authoring.md`: what its site is for, its tracks, its notation, and anything it does differently.
|
|
8
|
+
Where the two differ, the project's file wins.
|
|
9
|
+
|
|
10
|
+
## Three kinds of writing
|
|
11
|
+
|
|
12
|
+
- **Pages say what is.**
|
|
13
|
+
They describe the project as it stands, quote the code that exists, and only ever describe the current state.
|
|
14
|
+
They are rewritten whenever the project changes, at an entry's `publish` stage, and are grouped in tracks (`TRACKS` in `site/src/lib/site.ts`).
|
|
15
|
+
- **Math notes say what is true**, independently of the project: one idea to a note, at enough length to be worth reading alone.
|
|
16
|
+
A note the site already has is linked, never rewritten in another document.
|
|
17
|
+
- **Archive documents discuss what may be.**
|
|
18
|
+
They argue, weigh alternatives and leave room for doubt, as they stood when approved.
|
|
19
|
+
Once approved they are frozen: they may drift from the code, and that is what they are for.
|
|
20
|
+
|
|
21
|
+
Before writing about an idea, search for it: `grep -rni '<the idea>' site/content/`.
|
|
22
|
+
If the site explains it, link there.
|
|
23
|
+
|
|
24
|
+
## Where things go
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
site/content/
|
|
28
|
+
landing.md the home page's prose
|
|
29
|
+
<track>/<slug>/index.md a page of a track
|
|
30
|
+
math/<slug>/index.md a math note
|
|
31
|
+
archive/<slug>/index.md an entry, opened by `bin/wf start`
|
|
32
|
+
archive/<slug>/<stage>.md its documents, one per stage that has one
|
|
33
|
+
archive/<slug>/statements/<x>.md statements its documents show
|
|
34
|
+
references.bib the bibliography
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
A document is `.md`, or `.svx` when it imports a component.
|
|
38
|
+
Anything else a document uses (images, figure specs, data) goes in its own folder and is referenced relatively.
|
|
39
|
+
|
|
40
|
+
## Frontmatter
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
---
|
|
44
|
+
title: Retractions
|
|
45
|
+
summary: Maps from a tangent space back onto the manifold. # one plain sentence
|
|
46
|
+
depends_on: [tangent-space, archive/normal/math]
|
|
47
|
+
katex_macros:
|
|
48
|
+
'\retr': '\operatorname{R}'
|
|
49
|
+
---
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- `title` may contain inline math.
|
|
53
|
+
An entry's documents default to their stage's name ("Mathematics", "Plan"), which is usually right.
|
|
54
|
+
- `summary` is shown in lists, the sidebar, previews and `llms.txt`.
|
|
55
|
+
Without it, the first paragraph stands in, so either write one or make the first paragraph a good summary.
|
|
56
|
+
- `depends_on` lists what a reader must understand first: a bare slug is a math note, anything else a key (`concepts/graph`, `archive/normal/math`).
|
|
57
|
+
These are the solid arrows of the map on the Mathematics page, so list real prerequisites, not everything mentioned.
|
|
58
|
+
- A page also needs `order`, its place in its track.
|
|
59
|
+
Its `depends_on` names no page of its own track at its place or after it.
|
|
60
|
+
- Where the mathematics has parts (`MATH_PARTS` in `site/src/lib/site.ts`), a math note needs `part` and `order`, its part and its place within it, and its `depends_on` names math notes alone, none at its own place or after it.
|
|
61
|
+
The build refuses a note that breaks either rule.
|
|
62
|
+
- A page that moves lists the keys it had under `formerly` (`formerly: [start/old-slug]`), so that the entries that name it, frozen once done, still resolve to it.
|
|
63
|
+
- An entry's `index.md` lists the `pages` it changed (written at `publish`), the entries it `revises` (given to `wf start`), and what it `amends` in entries that are done (`workflow.md`, under "Amending a done entry"), with whatever else the project's workflow asks of it.
|
|
64
|
+
|
|
65
|
+
## Mathematics, statements and citations
|
|
66
|
+
|
|
67
|
+
As `markup.md` says, with this site's particulars:
|
|
68
|
+
|
|
69
|
+
- The site-wide KaTeX macros are in `site/katex.config.ts`; notation for one document goes in its `katex_macros`.
|
|
70
|
+
- A reference into another document names it by its key: `[](eq:math/<slug>/<tag>)`, `[%full](statement:archive/<entry>/<document>/<name>)`.
|
|
71
|
+
- `Statement` and `Proof` are imported from `$lib/components/Statement.svelte` and `$lib/components/Proof.svelte`.
|
|
72
|
+
- Bibliography entries go in `site/content/references.bib`.
|
|
73
|
+
|
|
74
|
+
## Links
|
|
75
|
+
|
|
76
|
+
- Write links the way the files sit on disk: `[retractions](../../math/retraction/)`, `[the plan](plan.md)`, `[the guide](../../guide/)`.
|
|
77
|
+
The build rewrites them to the site's URLs and reports a link to a document that does not exist.
|
|
78
|
+
- A section's anchor is its heading in lowercase, with `$` removed and every run of characters other than `a`–`z` and digits turned into one hyphen: `## Fubini's theorem` is `#fubini-s-theorem`.
|
|
79
|
+
Anchors are not checked, so work them out from the heading as written.
|
|
80
|
+
- Never put a link inside a heading.
|
|
81
|
+
|
|
82
|
+
## Prose
|
|
83
|
+
|
|
84
|
+
Write in complete sentences and paragraphs, in the register of a textbook, with tables and lists only where they genuinely help.
|
|
85
|
+
Never refer to the conversation that produced a document: it is read later, by someone who was not there.
|
|
86
|
+
Prefer a concrete example to an abstract definition alone.
|
|
87
|
+
Name things the way the code names them, in backticks; generics such as `Q<B, M>` must be in backticks anyway, since `<` and `{` are Svelte syntax outside code and math.
|
|
88
|
+
|
|
89
|
+
**One sentence to a line.**
|
|
90
|
+
In every `.md` and `.svx` file of the project, its documentation and its agents' documents alike, each sentence of prose starts on a new line and runs to its end on that line, however long; never break a line inside a sentence to keep it short.
|
|
91
|
+
A paragraph is its sentences on consecutive lines, and a blank line still ends it.
|
|
92
|
+
In a list item or a callout, each sentence after the first starts a new line at the item's indent or after the `> `.
|
|
93
|
+
A diff then shows which sentences changed.
|
|
94
|
+
Prettier leaves prose as it is written (its `proseWrap` is `preserve`, the default), and displayed equations, tables, code and frontmatter keep their own lines.
|
|
95
|
+
Archive documents approved before a project took up this rule are frozen as they were written.
|
|
96
|
+
|
|
97
|
+
## Callouts
|
|
98
|
+
|
|
99
|
+
GitHub-style blockquotes, with an optional title after the marker:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
> [!DECISION] Why conditioning belongs to the query
|
|
103
|
+
> ...
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`NOTE`, `TIP`, `WARNING`, `DECISION`, `TODO`.
|
|
107
|
+
A `[!TODO]` is an open question: `wf approve` refuses a document that still has one, so a draft carries its open questions as `[!TODO]`s until they are answered.
|
|
108
|
+
A page's `[!DECISION]` says briefly why something is the way it is and links to the archive entry that decided it.
|
|
109
|
+
|
|
110
|
+
## Code
|
|
111
|
+
|
|
112
|
+
- **Pages quote real code.**
|
|
113
|
+
A fence whose only line is `{path}` or `{path:start..end}` is replaced by those lines of the file (1-indexed, inclusive), with a caption linking to the repository.
|
|
114
|
+
Paths are relative to the document.
|
|
115
|
+
Quoting Rust doc comments renders them as Markdown.
|
|
116
|
+
- **Archive documents never quote with `{path}`.**
|
|
117
|
+
The quote is re-read at every build, so it would change as the code does, and a line range would eventually break the build.
|
|
118
|
+
Sketch the code inline, and when an existing interface matters, paste the lines and name the file and the commit they were read at.
|
|
119
|
+
- Sketches are compile-plausible, and show signatures and types rather than bodies, unless the body is the point.
|
|
120
|
+
|
|
121
|
+
## Figures
|
|
122
|
+
|
|
123
|
+
- **A graph** (a model, a factor graph, a timing chain, a wiring diagram) is drawn with `<ModelGraph spec={name} />`, from `$lib/components/ModelGraph.svelte`, with the spec in a `*.graph.ts` file beside the document, written with `defineGraph` from `$lib/graph/spec`.
|
|
124
|
+
The Markdown export describes it in words.
|
|
125
|
+
- **An image** is imported in the document's `<script>` (`import board from './board.jpg'`), so the build serves it under the site's base path, and placed with `<ImageFigure src={board} alt="…" width={…} height={…}>caption</ImageFigure>`, from `$lib/components/ImageFigure.svelte`, which opens it enlarged when clicked.
|
|
126
|
+
Its alt text says what the image shows for a reader who cannot see it, and its caption why it is there.
|
|
127
|
+
- **Anything else** is a Svelte component in the document's folder, referenced relatively.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# The development workflow
|
|
2
|
+
|
|
3
|
+
Every change to {{project}}'s code is an **entry** in the archive (`{{content}}/archive/<slug>/`), worked on in a branch of its own and moved through **stages**.
|
|
4
|
+
A person approves each stage; nothing advances by itself.
|
|
5
|
+
`bin/wf` keeps the record and enforces the rules; the `wf-*` skills do the work of each stage.
|
|
6
|
+
|
|
7
|
+
This file is the procedure.
|
|
8
|
+
`AGENTS.md` says when it applies (only when the user invokes one of its commands).
|
|
9
|
+
`authoring.md` and `markup.md` beside this file say how to write the documents, `.agents/reference/authoring.md` what this project writes differently, and `.agents/reference/stages/` what this project's stages ask beyond what their skills say.
|
|
10
|
+
|
|
11
|
+
This file belongs to `@mvarble/mesearch-workflow`, which writes it from `workflow.config.ts` whenever `mesearch-wf sync` runs.
|
|
12
|
+
Never edit it here: say what the project does differently in `AGENTS.md`, or change the workflow upstream.
|
|
13
|
+
|
|
14
|
+
## Kinds and stages
|
|
15
|
+
|
|
16
|
+
{{kinds-table}}
|
|
17
|
+
|
|
18
|
+
Each stage, what it produces, and the skill that works on it:
|
|
19
|
+
|
|
20
|
+
{{stages-table}}
|
|
21
|
+
|
|
22
|
+
And the commands that move an entry, all of them the user's to give:
|
|
23
|
+
|
|
24
|
+
| command | `bin/wf` |
|
|
25
|
+
| --------------------------------- | ------------------------------------------ |
|
|
26
|
+
| `/wf-start <slug> <kind> [about]` | `wf start <slug> --kind <kind> --title ...` |
|
|
27
|
+
| `/wf-approve` | `wf approve` |
|
|
28
|
+
| `/wf-reopen <stage> <reason>` | `wf reopen <stage> --reason ...` |
|
|
29
|
+
| `/wf-abandon <reason>` | `wf abandon --reason ...` |
|
|
30
|
+
| `/wf-resume <slug>` | `wf resume <slug>` |
|
|
31
|
+
| `/wf-status` | `wf status` |
|
|
32
|
+
|
|
33
|
+
`bin/wf kinds` lists the kinds as `workflow.config.ts` defines them.
|
|
34
|
+
|
|
35
|
+
## What the stages guarantee
|
|
36
|
+
|
|
37
|
+
`bin/wf check` verifies these on every pull request; `bin/wf guard`, a Claude Code hook in `.claude/settings.json`, refuses an edit that breaks one before it is made.
|
|
38
|
+
|
|
39
|
+
1. **One entry per branch.**
|
|
40
|
+
`.workflow/active` names it.
|
|
41
|
+
A branch changes the files of one entry only, and merges into `main` only once that entry is done or abandoned.
|
|
42
|
+
What the entry [amends](#amending-a-done-entry) in entries that are done is the one exception.
|
|
43
|
+
2. **An approved document is frozen.**
|
|
44
|
+
Its hash is recorded when it is approved, and it may change again only after its stage is reopened.
|
|
45
|
+
A checklist is the exception that proves the rule: its boxes are ticked at a later stage, and nothing else in it changes.
|
|
46
|
+
Once its entry is done, a document changes only by an [amendment](#amending-a-done-entry).
|
|
47
|
+
3. **Documents come in order.**
|
|
48
|
+
A stage's document is not written before the stage.
|
|
49
|
+
4. **Areas open as the entry advances.**
|
|
50
|
+
{{areas}}
|
|
51
|
+
5. **Approval is a gate, not a formality.**
|
|
52
|
+
`wf approve` refuses {{gates}}
|
|
53
|
+
|
|
54
|
+
Anything outside these areas (the workflow's tool, the skills, the site's own code) is not gated.
|
|
55
|
+
|
|
56
|
+
## Managed files
|
|
57
|
+
|
|
58
|
+
`mesearch-wf sync` writes the files that belong to `@mvarble/mesearch-workflow` rather than to the project: `bin/wf` and the engine in `.workflow/engine/`, the skills it ships, this file and the others in `.agents/reference/mesearch/`, and the documentation site's shared routes and components.
|
|
59
|
+
`.workflow/managed.json` lists them with their hashes.
|
|
60
|
+
`bin/wf guard` refuses an edit to one, and `bin/wf check` fails when one has changed.
|
|
61
|
+
A change to one is made upstream, in `@mvarble/mesearch-workflow`, and comes back with the next `sync`.
|
|
62
|
+
|
|
63
|
+
## Going back
|
|
64
|
+
|
|
65
|
+
A stage's work sometimes shows that an earlier stage was wrong.
|
|
66
|
+
Do not work around it: stop and tell the user what was found.
|
|
67
|
+
If they agree, they ask for `/wf-reopen <stage> <reason>`, which moves the entry back, marks every approval from that stage on as needing renewal, and records the reason in the entry's history.
|
|
68
|
+
The reopened document gets a `## Revisions` section saying what changed and why; each later stage is approved again on the way forward (unchanged, if nothing in it had to change).
|
|
69
|
+
|
|
70
|
+
The story is allowed to change.
|
|
71
|
+
It is not allowed to forget: the history shows every reopening, and git keeps every draft.
|
|
72
|
+
|
|
73
|
+
## A finished entry
|
|
74
|
+
|
|
75
|
+
When `publish` is approved the entry is done, `.workflow/active` is removed, and the branch is ready to merge.
|
|
76
|
+
A done entry's argument is never edited again.
|
|
77
|
+
When {{project}} later changes what an entry built, a new entry says so with `--revises <slug>`; the site then marks the old entry as revised, and the pages show both under "How this came to be".
|
|
78
|
+
|
|
79
|
+
An entry set aside with `/wf-abandon` keeps its documents, approved or not, and can be taken up again with `/wf-resume`.
|
|
80
|
+
|
|
81
|
+
## Amending a done entry
|
|
82
|
+
|
|
83
|
+
The archive's documents refer to what changes after them: math notes and their equations and statements, pages and their headings, anything else the project keeps current.
|
|
84
|
+
A reference is kept true: it follows what moves, and where what it cited is gone, the document says in a few words what it was.
|
|
85
|
+
That is the one change a done entry admits.
|
|
86
|
+
What it claimed, measured and weighed stays as it was approved.
|
|
87
|
+
|
|
88
|
+
- Only at its `publish` stage may an entry change another's files, and only a done entry's stage documents ({{documents}}) and statements.
|
|
89
|
+
`bin/wf guard` refuses anything else.
|
|
90
|
+
- The entry lists what it changed under `amends` in its `index.md`: a document as `archive/<slug>/<stage>`, a statement as `archive/<slug>/statements/<name>`.
|
|
91
|
+
- `wf approve` refuses the publish if a done entry's file changed and is not listed, or is listed and did not change.
|
|
92
|
+
On approval it writes the amended document's new hash into the amended entry's `workflow.json`, with an `amend` event naming the amending entry.
|
|
93
|
+
The commit of the document's own approval stays in the record, and is where its text before the amendment is.
|
|
94
|
+
Commit every `workflow.json` it names.
|
|
95
|
+
- Nothing mechanical limits an amendment to references: the person who approves the publish reads the diff.
|
|
96
|
+
Never use an amendment to change what a document argues or measured; that is what a new entry with `--revises` is for.
|
|
97
|
+
|
|
98
|
+
## Revisions within a stage
|
|
99
|
+
|
|
100
|
+
A stage is a conversation.
|
|
101
|
+
Each time the user asks a question or a change, the document is revised, and each revision is committed: the archive keeps the final draft, and git keeps the back-and-forth.
|
|
102
|
+
The archive itself does not record the drafts, only the final text and any reopenings.
|
|
103
|
+
|
|
104
|
+
## Before pushing
|
|
105
|
+
|
|
106
|
+
Run `bin/wf check`, which checks the rules above against `origin/main`, and the project's own checks, which `AGENTS.md` lists.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-abandon
|
|
3
|
+
description: Set the active entry aside, keeping its documents in the archive, in {{project}}'s development workflow. Use only when the user invokes /wf-abandon.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: '<reason>'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wf-abandon: set an entry aside
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. Get the reason from the user if they gave none: it is shown in the archive.
|
|
13
|
+
2. Commit any work on the entry's documents the user wants kept; uncommitted drafts of code should be discarded or committed only if the user says so.
|
|
14
|
+
3. Run `bin/wf abandon --reason "<reason>"`.
|
|
15
|
+
4. Commit what it changed ("Set <slug> aside: <reason>").
|
|
16
|
+
5. Reply that the entry's documents stay in the archive, and that `/wf-resume <slug>` takes it up again on any branch.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-approve
|
|
3
|
+
description: Record the user's approval of the active entry's current stage and move it to the next, in {{project}}'s development workflow. Use only when the user invokes /wf-approve; never on your own judgment.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: ''
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wf-approve: approve the current stage
|
|
9
|
+
|
|
10
|
+
The user has read the stage's work and accepts it.
|
|
11
|
+
Their invoking this skill is the approval; it is never given on their behalf.
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
1. Run `bin/wf status` and say which stage of which entry is being approved.
|
|
16
|
+
2. If the stage's document, or anything the stage changed, is uncommitted, show the user what is uncommitted and ask whether to commit it as part of the approval.
|
|
17
|
+
Do not commit work the user has not seen.
|
|
18
|
+
3. Run `bin/wf approve`.
|
|
19
|
+
If it refuses, report each problem it lists and stop: the stage is not done.
|
|
20
|
+
Do not fix the problems in the same breath; the user decides what happens next.
|
|
21
|
+
4. Commit what `wf` changed (`workflow.json`, the `workflow.json` of every entry it amended, and `.workflow/active` when the entry is finished) as "Approve the <stage> of <slug>".
|
|
22
|
+
5. Reply with the next stage and its skill.
|
|
23
|
+
When the entry is done, say so, and that the branch can be merged once `bin/wf check --merge` passes.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-build
|
|
3
|
+
description: Build the active entry by working through its approved plan, task by task, with a check and a commit per task, in {{project}}'s development workflow. Use only when the user invokes /wf-build.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: '[a task to start from, or a limit such as "the first three"]'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wf-build: the build
|
|
9
|
+
|
|
10
|
+
Work through `plan.md` in order: do each task, check it, tick its box, commit.
|
|
11
|
+
|
|
12
|
+
## Before anything
|
|
13
|
+
|
|
14
|
+
Run `bin/wf status --expect build`.
|
|
15
|
+
If it fails, stop and tell the user what it said.
|
|
16
|
+
|
|
17
|
+
Read `.agents/reference/mesearch/workflow.md` once per session, the entry's `plan.md` and the documents it was distilled from, the rules in `AGENTS.md`, and `.agents/reference/stages/build.md` if the project has it: how a task is checked here, and what else a build does.
|
|
18
|
+
|
|
19
|
+
## Each task
|
|
20
|
+
|
|
21
|
+
1. Do exactly what the task says.
|
|
22
|
+
Details it leaves open (private helpers, local names, the order of statements) are yours to decide.
|
|
23
|
+
2. Check it as the task and the project's build steps say.
|
|
24
|
+
Do not move on with anything failing.
|
|
25
|
+
A task only the user can do (at a bench, say) is done by them, or with them: say what to run and what to expect, and do not tick the box until they report the result.
|
|
26
|
+
3. Tick the task's box in `plan.md`; change nothing else in the plan, since `wf check` refuses any other edit to it.
|
|
27
|
+
4. Commit, with a message saying what the task added.
|
|
28
|
+
|
|
29
|
+
Commit often, push when your environment expects it, and report progress between tasks when the user asked for only some of them.
|
|
30
|
+
|
|
31
|
+
## When the plan is wrong
|
|
32
|
+
|
|
33
|
+
If a task cannot be done as planned (an interface does not allow it, a check shows an earlier document wrong, the plan misses a step), stop.
|
|
34
|
+
Tell the user what was found and which stage it belongs to, and suggest `/wf-reopen <stage> <reason>`.
|
|
35
|
+
Do not deviate from the plan quietly, and never edit an approved document.
|
|
36
|
+
|
|
37
|
+
## At the end
|
|
38
|
+
|
|
39
|
+
When every box is ticked, run the plan's "Done when" checks and `bin/wf check`, and whatever else the project's build steps ask at the end.
|
|
40
|
+
Reply that `/wf-approve` moves on.
|
|
41
|
+
Never approve yourself.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-plan
|
|
3
|
+
description: Write or revise the plan of the active entry, a checklist the build works through in order, in {{project}}'s development workflow. Use only when the user invokes /wf-plan.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: '[what to change]'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wf-plan: the plan
|
|
9
|
+
|
|
10
|
+
What will be done, in order, and how anyone will know it worked: a checklist that the build works through task by task.
|
|
11
|
+
Whatever the plan rests on is already decided, in an earlier stage or in a decision entry; a choice that is expensive to reverse does not belong buried in a task.
|
|
12
|
+
|
|
13
|
+
## Before anything
|
|
14
|
+
|
|
15
|
+
Run `bin/wf status --expect plan`.
|
|
16
|
+
If it fails, stop and tell the user what it said.
|
|
17
|
+
|
|
18
|
+
Read `.agents/reference/mesearch/workflow.md` once per session, the entry's `index.md`, and `.agents/reference/stages/plan.md` if the project has it: what this project's plan is distilled from, what else to read first, and the plan's template.
|
|
19
|
+
If writing the plan shows a hole in an earlier stage, stop and suggest `/wf-reopen <stage> <reason>` rather than deciding it here.
|
|
20
|
+
|
|
21
|
+
## Writing
|
|
22
|
+
|
|
23
|
+
`{{content}}/archive/<slug>/plan.md`, in groups of tasks, each a box:
|
|
24
|
+
|
|
25
|
+
```markdown
|
|
26
|
+
---
|
|
27
|
+
summary: <one sentence>
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## <Group>
|
|
31
|
+
|
|
32
|
+
- [ ] <One task, small enough for one commit, and how to know it is done.>
|
|
33
|
+
- [ ] ...
|
|
34
|
+
|
|
35
|
+
## Done when
|
|
36
|
+
|
|
37
|
+
<The checks that must pass at the end.>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The project's template, where it has one, says what else the plan holds and how a task names its check.
|
|
41
|
+
|
|
42
|
+
- Order the tasks so that each builds on finished ones, and what is built works after each.
|
|
43
|
+
- A task says what to do, not how: the how is decided in an earlier stage or in the build.
|
|
44
|
+
|
|
45
|
+
Commit each revision.
|
|
46
|
+
When the plan is right, reply that `/wf-approve` starts the build.
|
|
47
|
+
Never approve yourself.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-publish
|
|
3
|
+
description: Bring {{project}}'s documentation pages up to date with what the active entry built or decided, and link the entry to them; the last stage of {{project}}'s development workflow. Use only when the user invokes /wf-publish.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: '[pages to start with, or what to change]'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wf-publish: the pages
|
|
9
|
+
|
|
10
|
+
The entry is built (or, for a decision, argued).
|
|
11
|
+
Now the pages that say what {{project}} _is_ must say it.
|
|
12
|
+
The archive discussed what might be; the pages tell what is.
|
|
13
|
+
|
|
14
|
+
## Before anything
|
|
15
|
+
|
|
16
|
+
Run `bin/wf status --expect publish`.
|
|
17
|
+
If it fails, stop and tell the user what it said.
|
|
18
|
+
|
|
19
|
+
Read `.agents/reference/mesearch/authoring.md` and `.agents/reference/authoring.md` once per session, the entry's documents, and the code it added, and `.agents/reference/stages/publish.md` if the project has it: which pages an entry of each kind changes, and what else the publish lists.
|
|
20
|
+
Read the pages that are affected (the tracks under `{{content}}/`, the landing page) before changing them.
|
|
21
|
+
|
|
22
|
+
## Writing
|
|
23
|
+
|
|
24
|
+
- **The pages.**
|
|
25
|
+
Add or rewrite the pages that describe what now exists, quoting the real code with `{path:start..end}` fences, and linking the math notes for the mathematics.
|
|
26
|
+
A choice a reader would wonder about gets a short `> [!DECISION]` linking the entry that made it.
|
|
27
|
+
- **Drop what is no longer true.**
|
|
28
|
+
A page describes only what now is.
|
|
29
|
+
What a revised entry built and this one replaced disappears from the pages; it stays in the archive.
|
|
30
|
+
- **The entry's `index.md`.**
|
|
31
|
+
Replace its opening paragraph with what the entry did, for a reader of the archive, and list every page it changed under `pages`, with whatever else the project's publish lists.
|
|
32
|
+
`wf approve` refuses a changed page that is not listed, and a listed one the branch did not change.
|
|
33
|
+
- **What it amends.**
|
|
34
|
+
Where the entry moved or removed something a done entry's document refers to (a math note's equation, a page, a heading), change that reference in the done entry's document, and list it under `amends` in the entry's `index.md` (`workflow.md`, under "Amending a done entry").
|
|
35
|
+
Change nothing else there.
|
|
36
|
+
|
|
37
|
+
Build the site (`cd site && pnpm build`) and fix every warning and broken link.
|
|
38
|
+
Commit as you go.
|
|
39
|
+
|
|
40
|
+
When the pages are right, run `bin/wf check` and reply that `/wf-approve` finishes the entry, after which the branch is ready to merge.
|
|
41
|
+
Never approve yourself.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-reopen
|
|
3
|
+
description: Move the active entry back to an earlier stage so its approved document can be revised, recording why, in {{project}}'s development workflow. Use only when the user invokes /wf-reopen.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: '<stage> <reason>'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wf-reopen: go back to an earlier stage
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. Work out the stage and the reason from what the user wrote; ask for the reason if there is none.
|
|
13
|
+
It is recorded in the entry's history, so make it one plain sentence about what was wrong.
|
|
14
|
+
2. Run `bin/wf reopen <stage> --reason "<reason>"`.
|
|
15
|
+
If it refuses, tell the user what it said and stop.
|
|
16
|
+
3. In the reopened stage's document, add (or extend) a `## Revisions` section at its end with a dated paragraph: what is being changed, and why.
|
|
17
|
+
Fill in what actually changed as the revision is made.
|
|
18
|
+
4. Commit `workflow.json` and the document ("Reopen the <stage> of <slug>: <reason>").
|
|
19
|
+
5. Reply with the reopened stage's skill.
|
|
20
|
+
Every later stage will be approved again on the way forward.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-resume
|
|
3
|
+
description: Take up an abandoned entry again at the stage it was left, in {{project}}'s development workflow. Use only when the user invokes /wf-resume.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: '<slug>'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wf-resume: take an entry up again
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. If the current branch is `main`, make a branch first (`git switch -c <slug>`), unless your environment names the branch to work on.
|
|
13
|
+
2. Run `bin/wf resume <slug>`.
|
|
14
|
+
If it refuses, tell the user what it said and stop.
|
|
15
|
+
3. Commit `workflow.json` and `.workflow/active` ("Resume <slug>").
|
|
16
|
+
4. Read the entry's documents, then reply with where it stands and the stage's skill.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-start
|
|
3
|
+
description: Open a new entry ({{kinds-list}}) on the current branch of {{project}}'s development workflow. Use only when the user invokes /wf-start.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: '<slug> <{{kinds}}> [what it is about] [revises <slug>]'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wf-start: open an entry
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. Work out the slug (lowercase words joined by hyphens, named after the idea), the kind, a title, and any entry it revises from what the user wrote.
|
|
13
|
+
Ask if the kind is unclear.
|
|
14
|
+
The kinds, as `bin/wf kinds` lists them:
|
|
15
|
+
|
|
16
|
+
{{kinds-describe}}
|
|
17
|
+
|
|
18
|
+
2. If the current branch is `main`, make a branch for the entry first (`git switch -c <slug>`), unless your environment names the branch to work on.
|
|
19
|
+
3. Run `bin/wf start <slug> --kind <kind> --title "<Title>"`, adding `--revises <slug>,...` when it changes the story of finished entries.
|
|
20
|
+
If it refuses, tell the user what it said and stop.
|
|
21
|
+
4. Replace the `[!TODO]` in `{{content}}/archive/<slug>/index.md` with a paragraph saying what the entry sets out to do and why, from what the user said.
|
|
22
|
+
Ask for what is missing rather than inventing it.
|
|
23
|
+
5. Commit the entry folder and `.workflow/active` ("Start <slug>: <title>").
|
|
24
|
+
6. Reply with the first stage's skill (`bin/wf status` names it).
|
|
25
|
+
Do not start that stage until the user invokes it.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-status
|
|
3
|
+
description: Report where the active entry of {{project}}'s development workflow stands and what comes next. Use only when the user invokes /wf-status.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
argument-hint: ''
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wf-status
|
|
9
|
+
|
|
10
|
+
1. Run `bin/wf status`, and `bin/wf check` to see whether the branch keeps the rules.
|
|
11
|
+
2. Summarize: the entry and its kind, the stage, what has been approved and when (from `workflow.json`), the plan's progress if it has one, any problem `check` found, and the command that comes next.
|
|
12
|
+
3. With no active entry, list the entries in the archive with their stages, and say how one is started.
|